/*
 * $Id: $
 */
package org.rcgwt.client.ui.grid.model;

import org.rcgwt.client.ui.grid.RcGrid;
import org.rcgwt.client.ui.grid.event.IModelChangeState;
import org.rcgwt.client.ui.grid.provider.IDataLoadedCallback;

import com.google.gwt.event.logical.shared.HasValueChangeHandlers;

/**
 * Base design model for {@link RcGrid} component For insertion use
 * {@link IDataLoadedCallback}
 * 
 * @author Matthieu ROBERT
 * 
 */
public interface IDataModel extends HasValueChangeHandlers<IModelChangeState>
/* ,IDataReadyCallback */ {

    /**
     * Returns the number of rows in the model.
     * 
     * @return the number of rows in the model
     */
    int getRowCount();

    /**
     * Returns the value for the cell at <code>columnName</code> and
     * <code>rowIndex</code>.
     * 
     * @param rowModelIndex
     *            the row whose value is to be queried
     * @param columnName
     *            the column whose value is to be queried
     * @return the value Object at the specified cell
     */
    Object getValueAt(int rowModelIndex, String columnName);

    /**
     * if {@link getRowCount} is not available
     * 
     * @param rowModelIndex
     * @return the indexed row exists
     */
    boolean isRowAvailable(int rowModelIndex);

}